package cn.heycm.blog.common.entity.session;

/**
 * Session 请求上下文
 *
 * @author hey
 * @version 1.0
 * @since 2024/9/15 16:58
 */
public class SessionContext {

    private static final ThreadLocal<Session> CONTEXT = new ThreadLocal<>();

    private SessionContext() {}

    public static void set(Session session) {
        CONTEXT.set(session);
    }

    public static Session get() {
        return CONTEXT.get();
    }

    public static void remove() {
        CONTEXT.remove();
    }
}
